<template>
  <div>
    <div style="width: 100%;text-align: right">
      <el-button size="mini" type="primary" @click="addReceivablesPlan">
        <i class="el-icon-plus"/>
        新建回款计划
      </el-button>
    </div>
    <el-table :data="tableData" v-loading="loading" style="width: 100%;margin-top: 8px">
      <el-table-column show-overflow-tooltip align="center" min-width="135" label="期数" prop="num"/>
      <el-table-column show-overflow-tooltip align="center" min-width="155" label="客户名称" prop="customerName"/>
      <el-table-column show-overflow-tooltip align="center" min-width="135" label="合同编号" prop="contractSn"/>
      <el-table-column show-overflow-tooltip align="center" min-width="155" label="计划回款金额" prop="money"/>
      <el-table-column show-overflow-tooltip align="center" min-width="175" label="计划回款日期" prop="returnDate"/>
      <el-table-column show-overflow-tooltip align="center" min-width="135" label="计划回款方式" prop="returnTypeId"/>
      <el-table-column show-overflow-tooltip align="center" min-width="135" label="提前几日提醒" prop="remind"/>
      <el-table-column show-overflow-tooltip align="center" min-width="175" label="备注" prop="remark"/>
      <el-table-column show-overflow-tooltip align="center" min-width="135" label="操作">
        <template scope="scope">
          <el-button type="text" @click="updateReceivablesPlan(scope.row.id)">编辑</el-button>
          <el-button type="text" @click="deleteReceivablesPlan(scope.row.id)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'ReceivablesPlanDrawerTable',
  components: {},
  props: {
    tableData: {
      type: Array
    },
    loading: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {}
  },
  // 在实例创建完成后被立即调用
  created() {

  },
  // 实例被挂在后调用
  mounted() {

  },
  // 方法
  methods: {
    // 新建回款计划
    addReceivablesPlan() {
      this.$emit('addReceivablesPlan')
    },
    // 编辑回款计划
    updateReceivablesPlan(receivablesPlanId) {

    },
    // 删除回款计划
    deleteReceivablesPlan(receivablesPlanId) {

    }
  }
}
</script>

<style scoped>

</style>
